home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxshade4.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.3 KB  |  65 lines

  1. /* Copyright (C) 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxshade4.h,v 1.2 2000/09/19 19:00:40 lpd Exp $ */
  20. /* Internal definitions for triangle shading rendering */
  21.  
  22. #ifndef gxshade4_INCLUDED
  23. #  define gxshade4_INCLUDED
  24.  
  25. #define mesh_max_depth (16 * 3 + 1)    /* each recursion adds 3 entries */
  26. typedef struct mesh_frame_s {    /* recursion frame */
  27.     mesh_vertex_t va, vb, vc;    /* current vertices */
  28.     bool check_clipping;
  29. } mesh_frame_t;
  30. /****** NEED GC DESCRIPTOR ******/
  31.  
  32. /*
  33.  * Define the fill state structure for triangle shadings.  This is used
  34.  * both for the Gouraud triangle shading types and for the Coons and
  35.  * tensor patch types.
  36.  *
  37.  * The shading pointer is named pshm rather than psh in case subclasses
  38.  * also want to store a pointer of a more specific type.
  39.  */
  40. #define mesh_fill_state_common\
  41.   shading_fill_state_common;\
  42.   const gs_shading_mesh_t *pshm;\
  43.   gs_fixed_rect rect;\
  44.   int depth;\
  45.   mesh_frame_t frames[mesh_max_depth]
  46. typedef struct mesh_fill_state_s {
  47.     mesh_fill_state_common;
  48. } mesh_fill_state_t;
  49. /****** NEED GC DESCRIPTOR ******/
  50.  
  51. /* Initialize the fill state for triangle shading. */
  52. void mesh_init_fill_state(P5(mesh_fill_state_t * pfs,
  53.                  const gs_shading_mesh_t * psh,
  54.                  const gs_rect * rect,
  55.                  gx_device * dev, gs_imager_state * pis));
  56.  
  57. /* Fill one triangle in a mesh. */
  58. void mesh_init_fill_triangle(P5(mesh_fill_state_t * pfs,
  59.                 const mesh_vertex_t *va,
  60.                 const mesh_vertex_t *vb,
  61.                 const mesh_vertex_t *vc, bool check_clipping));
  62. int mesh_fill_triangle(P1(mesh_fill_state_t * pfs));
  63.  
  64. #endif /* gxshade4_INCLUDED */
  65.